#!/bin/sh
# If the latest desktop was not built yet, it builds --- endless cycle

# 1. Start and loading configuration
test -r autotest.conf || {
 echo "$0: Cannot find autotest.conf (make sure you edit autotest.conf.dist first)"
 exit 127
 }
test -r autotest.conf && . ./autotest.conf

while [ true ]; do
 date
 echo "trunk" > $LOCKFILE
 ./build-latest && ./alarm
 rm -f $LOCKFILE
 date
 sleep $WAITBETWEENBUILDS
 while [ -e $LOCKFILE ]; do
  sleep $WAITBETWEENBUILDS
  done
 done
